package com.scorpio.elem;

import com.alibaba.fastjson.JSONObject;

public abstract class BaseElem {
    private ElemType type = ElemType.TEXT;
    //是否发送的消息
    private boolean isSendMessage;
    //接受人id
    private String acceptorId;
    //发送人id
    private String senderId;
    //linux时间
    private long time = System.currentTimeMillis() / 1000;
    //唯一标识
    private String identifying;

    enum ElemType {
        TEXT
    }

    public void setType(String name) {
        if (ElemType.TEXT.name().equals(name)) {
            type = ElemType.TEXT;
        }
    }

    public void setType(ElemType type) {
        this.type = type;
    }

    public ElemType getType() {
        return type;
    }

    public String getAcceptorId() {
        return acceptorId;
    }

    public void setAcceptorId(String acceptorId) {
        this.acceptorId = acceptorId;
    }

    public String getSenderId() {
        return senderId;
    }

    public void setSenderId(String senderId) {
        this.senderId = senderId;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public String getIdentifying() {
        return identifying;
    }

    public void setIdentifying(String identifying) {
        this.identifying = identifying;
    }

    public abstract JSONObject toMessageJson();
}
